home *** CD-ROM | disk | FTP | other *** search
/ The Amiga Game Guide / AmigaGameGuide_CD.iso / Amiga / Game-Installer / WHD_Installers / Games_A-B / Aladdin / Install < prev    next >
Text File  |  1977-12-31  |  3KB  |  150 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README") ;name of readme file
  4. (set #last-disk 3)          ;amount of disks
  5.  
  6. ;****************************
  7. ;----------------------------
  8. ; Checks if given program is reachable via the path
  9. ; if not abort install
  10. ; IN:  #program - to check
  11. ; OUT: -
  12.  
  13. (procedure P_chkrun
  14.   (if
  15.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  16.     ("")
  17.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  18.   )
  19. )
  20.  
  21. ;----------------------------
  22. ; Create disk-Image using DIC
  23. ; IN:  #dest        - DestinationPath
  24. ;      #CI_diskname - DiskName
  25. ;      #CI_diskno   - DiskNumber
  26. ;      #CI_drive    - DriveToReadFrom
  27. ; OUT: -
  28.  
  29. (procedure P_image
  30.   (message ("\nInsert \"%s\" into drive %s !\n\n(make sure it's the right disk because it will not checked)" #CI_diskname #CI_drive))
  31.   (if
  32.     (= 0 (run ("cd \"%s\"\nDIC %s FD=%ld LD=%ld >con:///1000//CLOSE" #dest #CI_drive #CI_diskno #CI_diskno)))
  33.     ("")
  34.     (abort "\"DIC\" has failed to create a diskimage")
  35.   )
  36. )
  37.  
  38. ;****************************
  39.  
  40. (if
  41.   (exists #readme-file)
  42.   (if
  43.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  44.     ("")
  45.     (run ("SYS:Utilities/More %s" #readme-file))
  46.   )
  47. )
  48.  
  49. (set #program "WHDLoad")
  50. (P_chkrun)
  51.  
  52. (set #program "DIC")
  53. (P_chkrun)
  54.  
  55. ; in expert mode ask for source drive
  56. (if
  57.   (= @user-level 2)
  58.   (
  59.     (set #CI_drive
  60.       (askchoice
  61.     (prompt "Select source drive for diskimages")
  62.     (default 0)
  63.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  64.     (help @askchoice-help)
  65.       )
  66.     )
  67.     (select #CI_drive
  68.       (set #CI_drive "DF0:")
  69.       (set #CI_drive "DF1:")
  70.       (set #CI_drive "RAD:")
  71.       (set #CI_drive
  72.         (askstring
  73.           (prompt "Select source drive for diskimages")
  74.           (default "DF0:")
  75.           (help @askstring-help)
  76.         )
  77.       )
  78.     )
  79.   )
  80.   (set #CI_drive "DF0:")
  81. )
  82.  
  83. (set @default-dest
  84.   (askdir
  85.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  86.     (help @askdir-help)
  87.     (default @default-dest)
  88.     (disk)
  89.   )
  90. )
  91. (set #dest (tackon @default-dest @app-name))
  92. (if
  93.   (exists #dest)
  94.   (
  95.     (set #choice
  96.       (askbool
  97.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  98.         (default 1)
  99.         (choices "Delete" "Skip")
  100.         (help @askbool-help)
  101.       )
  102.     )
  103.     (if
  104.       (= #choice 1)
  105.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  106.     )
  107.   )
  108. )
  109. (makedir #dest
  110.   (help @makedir-help)
  111.   (infos)
  112. )
  113.  
  114. ;----------------------------
  115.  
  116. (copyfiles
  117.   (help @copyfiles-help)
  118.   (source ("%s.slave" @app-name))
  119.   (dest #dest)
  120. )
  121. (copyfiles
  122.   (help @copyfiles-help)
  123.   (source ("%s.inf" @app-name ))
  124.   (newname ("%s.info" @app-name ))
  125.   (dest #dest)
  126. )
  127. (if
  128.   (exists #readme-file)
  129.   (copyfiles
  130.     (help @copyfiles-help)
  131.     (source #readme-file)
  132.     (dest #dest)
  133.   )
  134. )
  135.  
  136. (set #CI_diskno 1)
  137. (while
  138.   (<= #CI_diskno #last-disk)
  139.   (
  140.     (set #CI_diskname ("%s Disk %ld" @app-name #CI_diskno))
  141.     (P_image)
  142.     (set #CI_diskno (+ #CI_diskno 1))
  143.   )
  144. )
  145.  
  146. ;----------------------------
  147.  
  148. (exit)
  149.  
  150.